home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / nansisrc.arc / NANSI.DOC < prev   
Encoding:
Internet Message Format  |  1986-05-22  |  8.8 KB

  1. From mark@rsch.wisc.edu Wed May 14 18:05:13 1986
  2. Received: from rsch.wisc.edu by gumby.wisc.edu; Wed, 14 May 86 18:05:01 cdt
  3. Date: Wed, 14 May 86 18:04:16 CDT
  4. Message-Id: <8605142304.AA17570@rsch.wisc.edu>
  5. Received: by rsch.wisc.edu; Wed, 14 May 86 18:04:16 CDT
  6. From: Mark Spankus <mark@rsch.wisc.edu>
  7. To: melvin@gumby
  8. Subject: dito...
  9. Status: R
  10.  
  11.  
  12. >From dpz@topaz.RUTGERS.EDU (David P. Zimmerman) Sat May 10 20:46:09 1986
  13. Path: uwvax!topaz!dpz
  14. From: dpz@topaz.RUTGERS.EDU (David P. Zimmerman)
  15. Newsgroups: net.sources
  16. Subject: NANSI.SYS docs
  17. Message-ID: <4947@topaz.RUTGERS.EDU>
  18. Date: 11 May 86 01:46:09 GMT
  19. Organization: Rutgers Univ., New Brunswick, N.J.
  20. Lines: 199
  21. Keywords: rab oof
  22.  
  23.  
  24. nansi    - enhanced MS-DOS ansi console driver
  25.  
  26. SYNOPSIS
  27.     Include in \config.sys the line
  28.         device=nansi.sys
  29.  
  30. DESCRIPTION
  31.     Nansi.sys is a console driver which understands ANSI control
  32.     sequences. It has several advantages over ANSI.SYS (the driver
  33.     supplied with DOS):
  34.     1. It supports new escape sequences (see below).
  35.     2. It provides MUCH faster output under certain conditions.
  36.     3. It supports the 43-line mode of the EGA.
  37.     4. The darned bell is now 1/4 second instead of 1/2 second long.
  38.  
  39.     What a console driver does:
  40.     When you, for example, type
  41.         C:> type foo.txt
  42.     COMMAND.COM opens the file foo.txt, reads it, and writes it to
  43.     the console driver, which puts it up on the screen.
  44.  
  45.     Both ansi.sys and nansi.sys use IBM Video BIOS to control the screen.
  46.     However, nansi.sys bypasses BIOS if the screen is in a text mode; this
  47.     allows much faster operation under certain conditions.
  48.  
  49.     While putting text up on the screen, (n)ansi.sys keeps a lookout for
  50.     the escape character (chr(27), known as ESC); this character signals
  51.     the start of a terminal control sequence.
  52.     Terminal control sequences follow the format
  53.         ESC [ param; param; ...; param cmd
  54.     where
  55.         ESC    is the escape character chr$(27).
  56.         [    is the left bracket character.
  57.         param    is an ASCII decimal number, or a string in quotes.
  58.         cmd    is a case-specific letter identifying the command.
  59.     Usually, zero, one, or two parameters are given.  If parameters
  60.     are omitted, they usually default to 1; however, some commands
  61.     (KKR and DKOCT) treat the no-parameter case specially.
  62.     Spaces are not allowed between parameters.
  63.  
  64.     For example, both ESC[1;1H and ESC[H send the cursor to the home
  65.     position (1,1), which is the upper left.
  66.  
  67.     Either single or double quotes may be used to quote a string.
  68.     Each character inside a quoted string is equivalent to one numeric
  69.     parameter.  Quoted strings are normally used only for the Keyboard
  70.     Key Reassignment command.
  71.  
  72. Control Sequences
  73.     The following table lists the sequences understood by nansi.sys.
  74.     Differences between nansi.sys and the standard ansi.sys are marked
  75.     with a vertical bar (|).
  76.  
  77. Cursor Positioning
  78. Short    Long name        Format        Notes
  79. CUP    cursor position        ESC[y;xH    Sets cursor position.
  80. HVP    cursor position        ESC[y;xf    Same as CUP; not recommended.
  81. CUU    cursor up        ESC[nA        n = # of lines to move
  82. CUD    cursor down        ESC[nB
  83. CUF    cursor forward        ESC[nC        n = # of columns to move
  84. CUB    cursor backward        ESC[nD
  85. DSR    Device Status, Report!    ESC[6n        Find out cursor position.
  86. CPR    Cursor Position report    ESC[y;xR    Response to DSR, as if typed.
  87. SCP    Save Cursor Position    ESC[s        Not nestable.
  88. RCP    Restore Cursor Position ESC[u
  89.  
  90. Editing
  91. ED    Erase in Display    ESC[2J    Clears screen.
  92. EL    Erase in Line        ESC[K    Clears to end of line.
  93. IL  |    Insert Lines        ESC[nL    Inserts n blank lines at cursor line.
  94. DL  |    Delete Lines        ESC[nM    Deletes n lines including cursor line.
  95. ICH |    Insert Characters    ESC[n@    Inserts n blank chars at cursor.
  96. DCH |    Delete Characters    ESC[nP    Deletes n chars including cursor char.
  97.  
  98.  
  99. Mode-Setting
  100. SGR    Set Graphics Rendition    ESC[n;n;...nm    See character attribute table.
  101. SM    Set Mode        ESC[=nh        See screen mode table.
  102. RM    Reset Mode        ESC[=nl        See screen mode table.
  103. IBMKKR    Keyboard Key Reass.    ESC["string"p
  104.     The first char of the string gives the key to redefine; the rest
  105.     of the string is the key's new value.
  106.     To specify unprintable chars, give the ASCII value of the char
  107.     outside of quotes, as a normal parameter.
  108.     IBM function keys are two byte strings; see the IBM Basic manual.
  109.     For instance, ESC[0;";dir a:";13;p redefines function key 1 to
  110.     have the value "dir a:" followed by the ENTER key.
  111.       | If no parameters given, all keys are reset to their default values.
  112.  
  113. DKOCT | Output char translate    ESC[n;ny
  114.       | When first char is encountered in output request, it is replaced with
  115.       | the second char.  This might be useful for previewing text before
  116.       | sending it to a printer with a funny print wheel.
  117.       | If no parameters are given, all chars are reset to normal.
  118.  
  119.  
  120. Character Attributes
  121.     The Set Graphics Rendition command is used to select foreground
  122.     and background colors or attributes.
  123.     When you use multiple parameters, they are executed in sequence, and
  124.     the effects are cumulative.
  125.        Attrib code        Value
  126.         0        All attributes off (normal white on black)
  127.         1        Bold
  128.         4        Underline
  129.         5        Blink
  130.         7        Reverse Video
  131.         8        Invisible (but why?)
  132.         30-37        foregnd blk/red/grn/yel/blu/magenta/cyan/white
  133.         40-47        background
  134.  
  135. Screen Modes
  136.     The IBM BIOS supports several video modes; the codes given in the
  137.     BIOS documentation are used as parameters to the Set Mode command.
  138.       | (In bitmap modes, the cursor is simulated with a small blob (^V).)
  139.         Mode Code        Value
  140.         0        text 40x25 Black & White
  141.         1        text 40x25 Color
  142.         2        text 80x25 Black & White
  143.         3        text 80x25 Color
  144.         4        bitmap 320x200 4 bits/pixel
  145.         5        bitmap 320x200 1 bit/pixel
  146.         6        bitmap 640x200 1 bit/pixel
  147.         7        (cursor wrap kludge)
  148.         13 (EGA)    bitmap 320x200 4 bits/pixel ?
  149.         14 (EGA)    bitmap 640x200 4 bits/pixel
  150.         16 (EGA)    bitmap 640x350 4 bits/pixel
  151.     Mode 7 is an unfortunate kludge; Setting mode 7 tells the cursor
  152.     to wrap around to the next line when it passes the end of a line;
  153.     Resetting mode 7 tells the cursor to not wrap, but rather stay put.
  154.       | If your computer has the Enhanced Graphics Adaptor, modes between
  155.       | 8 and 15 are also supported; see the EGA BIOS for info.
  156.       | The EGA also lets you use a shorter character cell in text modes
  157.       | in order to squeeze 43 lines of text out of the 25-line text modes.
  158.       | To enter 43 line mode, set the desired 25-line text mode (0 to 3),
  159.       | then Set Mode 43.  For instance: ESC[=3h ESC[=43h.
  160.       | To exit 43 line mode, set the desired 25-line text mode again.
  161.       | Nansi.sys ignores mode 43 unless there is an EGA on your computer.
  162.  
  163. Faster Output
  164.       | Any program that sets the console to RAW mode, and buffers its
  165.       | output properly, can achieve extremely high screen update speeds in
  166.       | return for giving up the special functions of the keys ^C, ^S, and ^P.
  167.       | See IOCTL in the MS-DOS 3.x Technical Reference for more info.
  168.     Also, a small improvement in speed may be noticed with some
  169.     programs that use the DOS console in normal mode, as this driver
  170.     efficiently implements the (standard but undocumented) INT 29h
  171.     most-favored-device putchar used by DOS.
  172.  
  173. EXAMPLES
  174.     See the file setraw.doc for Macro Assembler, Lattice C,
  175.     and Microsoft C routines for entering and leaving raw mode.
  176.  
  177. BUGS
  178.     Insert and delete character do not work in graphics modes.
  179.     Graphics mode writing is slow.
  180.     The simulated cursor in graphics mode slows down single-char
  181.     writes by a factor of 3; it should be disable-able.
  182.     Does not support erase-to-end-of-screen and other useful functions.
  183.  
  184. Version
  185.     This version, 2.2, created February 1986.  Problems should
  186.     be reported to Daniel Kegel, 1-60 CIT, Pasadena, CA 91126
  187.     (or, after June 1986, 2648 169th Ave SE, Bellevue, Wa. 98008).
  188.     Your suggestions for improvement would be most welcome.
  189.  
  190. NOTE
  191.     This program may be distributed for educational and personal use
  192.     only.  Commercial use is verboten; get in touch with the author.
  193.  
  194. FILES
  195.     nansi.doc    - this file
  196.     nansi.hex    - compiled version  <Not supported by INFO-IBMPC>
  197.         Convert nansi.hex into nansi.sys with the following commands
  198.         (you'll end up with 256 extra bytes at end, but who cares?):
  199.             debug            # Run DOS debugger
  200.             N nansi.hex        # Load the hex file
  201.             L
  202.             N nansi.sys        # Write it out
  203.             W
  204.             Q            # Quit- back to DOS.
  205.     nansi.cat    - concatenated sources
  206.         nansi    - makefile- shows how to assemble & link
  207.         nansi.asm    - device driver guts
  208.         nansi_d.asm    - definitions
  209.         nansi_p.asm    - ANSI parameter grabber
  210.         nansi_f.asm    - ANSI function handlers
  211.         nansi_i.asm    - device driver init routine
  212.     setraw.cat    - concatenated examples
  213.         setraw.asm    - for assembly programs
  214.         setraw.msc    - for Microsoft C programs
  215.         setraw.lc    - for Lattice C programs
  216.         rawtest.lc    - example for Lattice C only
  217. -- 
  218. Name: David P. Zimmerman    Nickname: "Davidann" (don't ask)
  219. Cute quote: " (well, *I* think it's cute!)
  220. Arpa: dzimmerman@blue.rutgers.edu
  221. Uucp: ...{harvard, allegra, seismo}!topaz!dpz
  222.  
  223.  
  224.  
  225.